package com.work.rcj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.work.rcj.common.model.Response;
import com.work.rcj.entity.Visit;
import com.work.rcj.mapper.VisitMapper;
import com.work.rcj.pojo.dto.VisitDto;
import com.work.rcj.pojo.vo.OldPeopleVo;
import com.work.rcj.pojo.vo.VisitVo;
import com.work.rcj.service.VisitService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author rcj
 * @since 2022-02-27
 */
@Service
public class VisitServiceImpl extends ServiceImpl<VisitMapper, Visit> implements VisitService {

    @Resource
    private VisitMapper visitMapper;

    @Override
    public IPage selectList(VisitDto dto) {
        IPage<VisitVo> page = new Page<>(dto.getPageIndex(), dto.getPageSize());
        List<VisitVo> list = visitMapper.visitList(page,dto);
        page.setRecords(list);
        return page;
    }
}
